import os

import dashscope
from dotenv import load_dotenv

load_dotenv("../ai.env")

dashscope.api_key = os.getenv("DASHSCOPE_API_KEY")

messages = [
    {"role": "user", "content": "介绍下你自己"}
]

response = dashscope.Generation.call(
    model="qwen-max",
    messages=messages,
    result_format='message'
)

print(response['output']['choices'][0]['message']['content'])
